package com.java.tutorials.jdk7.fileattribute;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Map;
import java.util.Set;
/**
 * Created by xuzhike on 2016/1/24.
 * http://www.java2s.com/Code/Java/JDK-7/ObtainingaMapoffileattributes.htm
 */
public class ObtainingaMapoffileattributes {
    public static void main(String[] args) throws Exception {
        Path path = Paths.get("e:/yjbWechat.txt");
        Map<String, Object> attrsMap = Files.readAttributes(path, "*");
        Set<String> keys = attrsMap.keySet();

        for (String attribute : keys) {
            System.out.println(attribute + ": " + Files.getAttribute(path, attribute));
        }

    }
}
